// 封装banner轮播图相关的业务代码

import { ref } from "vue";
import { getBannerAPI } from "@/apis/home.js";

export function useBanner() {
    const bannerList = ref([])

// 获取轮播图数据
    const getBannerList = async () => {
        await getBannerAPI({distributionSite: 2}).then((res) => {
            bannerList.value = res.result;
        })
    }

    getBannerList();

    return {
        bannerList
    }
}